/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package PasswrdChk01.Regras;

import InterfacesPasswordChecker01.PasswordSolverFactory01;
import PasswrdChk01.Componentes.Simbolos;

/**
 *
 * @author LABCCET
 */
public class PasswordSolver01 implements PasswordSolverFactory01 {
    String password;

    public PasswordSolver01(String senha) {
        this.password = senha;
    }
        
    @Override
    public void resolverSenha() {
        int pontos = somarPontosSenha(new Bonus(password));
        System.out.println(classificarSenha(pontos));
    }

    @Override
    public int somarPontosSenha(Bonus bonus) {
        return bonus.calcularBonusMultiTiposCaracteres() + bonus.calcularBonusDigitos() + bonus.calcularBonusSimbolos(new Simbolos()) + bonus.calcularBonusLetras() + bonus.calcularBonusTamanhoSenha();
    }

    @Override
    public String classificarSenha(int pontos) {
        if (pontos >= 15 && pontos < 25) {
            System.out.println("Pontua\u00e7\u00e3o = " + pontos + ";");
            return "Fraca";
        } else if (pontos >= 25 && pontos < 35) {
            System.out.println("Pontua\u00e7\u00e3o = " + pontos + ";");
            return "Media";
        } else if (pontos >= 35 && pontos < 45) {
            System.out.println("Pontua\u00e7\u00e3o = " + pontos + ";");
            return "Forte";
        } else if (pontos >= 45) {
            System.out.println("Pontua\u00e7\u00e3o = " + pontos + ";");
            return "Muito Forte";
        }
        System.out.println("Pontua\u00e7\u00e3o = " + pontos + ";");
        return "Muito Fraca";
    }
    
}
